//
//  HLMiddleView.m
//  HLMusicBox
//
//  Created by hulinhu on 2018/1/3.
//  Copyright © 2018年 hulinhu. All rights reserved.
//

#import "HLMiddleView.h"

@implementation HLMiddleView

-(instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        
        self.showsHorizontalScrollIndicator = NO;
        self.pagingEnabled = YES;
        self.contentSize = CGSizeMake(KScreenWidth*2, 0);
        [self configSubViews];
    }
    return self;
    
}
-(void)configSubViews{
    
    // 专辑图片视图配置
    self.playSongImage = [[HLImageView alloc] initWithFrame:CGRectMake(self.width*0.1, self.height*0.5-self.width*0.4, self.width*0.8, self.width*0.8)];
    self.playSongImage.clipsToBounds = YES;
    self.playSongImage.layer.cornerRadius = self.width*0.4;
    [self addSubview:self.playSongImage];
    
    // 歌词视图配置
    self.lrcView = [[HLLRCTableView alloc] initWithFrame:CGRectMake(KScreenWidth, 0, self.width, self.height)];
    [self addSubview:self.lrcView];
}

-(void)setModel:(HLSongItemModel *)model{
    
    [self.playSongImage sd_setImageWithURL:[NSURL URLWithString:model.songinfo.pic_big] placeholderImage:[UIImage imageNamed:@"cm2_simple_defaut_album_image"]];
    [self.lrcView handleLRCData:nil];
}


@end
